// const http = require('http');
// const myServer= http.createServer(function (request, response) {
//     response.writeHead(200, {'Content-Type': 'text/plain'});
//     response.end('Hello World\n');n
// });
// myServer.listen(8888)

// console.log('Server running at http://127.0.0.1:8888/');
const express=require('express')
const logger=require('morgan')
const userRouter=require("./routes/userRouter.js")
const app=express();
app.use(logger('dev'))
app.use(express.static(__dirname+"/public"))

app.use(express.json({limit:'2024kb'}))
app.use(express.urlencoded({extended:false}))

app.use("/",userRouter)
// app.get('/login',function(request,response){
//     response.writeHead(200, {'Content-Type': 'text/plain'});
//       response.end('Hello World\n');n
// })
app.listen(8888,()=>{
    console.log("服务器运行中，点击http://127.0.0.1:8888/访问");
})